<?php 	
	include('connect.php');
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
// header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE');

	// $content = 'adbbcc';
	// $tag = 'fef';

	$content = $_POST['content'];
	$tag = $_POST['tag'];

	$sql = 'select * from tags where content = "'.$content.'"';
	// $sql = "insert into tags(content,tag1) values ('{$content}','{$tag}')";


	$result = $db->query($sql);

	if(!$result){
		echo "SQL错误";
		exit;	
	}

	$rows = [];
	while($row = $result->fetch_array(MYSQLI_ASSOC)){
		$rows[] = $row;
	}

	echo json_encode($rows);
	// var_dump($rows);